<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" onclick="f5()" value="点击">
<script>
    // 单行注释
    /*js多行注释*/
    //1.无参无返回值
    function f1() {
        console.log("f1");
    }
    //2.有参无返回值
    function f2(name,age) {
        console.log(name+":"+age);
    }
    //3.无参有返回值
    function f3() {
        return "我是返回值";
    }
    //4.有参有返回值
    function f4(name) {
        return "SHa"+name
    }
    //第二种声明方法的方式
    let f5 = function(name,age){
        console.log(name+":"+age);
    }
    f5("诸葛亮",60);
    //第三种声明方法的方式
    let f6 = new Function("name","age","console.log(name+':'+age)");
    f6("司马懿",80);

    //调用
    f1();
    f2("刘备",50)
    let info = f3();
    console.log(info);

    let result=f4("赵辰");
    console.log(result);
</script>
</body>
</html>